<%@ page import="search.Recipe" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: wangx
  Date: 2024/12/7
  Time: 20:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title><%=request.getAttribute("title")%></title>
  <link rel="stylesheet" type="text/css" href="chushi/css/header_style.css">
  <link rel="stylesheet" type="text/css" href="chushi/css/footer.css">
  <link rel="stylesheet" type="text/css" href="chushi/css/recipe_style.css">
</head>
<body>
<header>
  <div class="container">
    <h1>菜谱管理系统</h1>
    <nav>
      <ul>
        <li><a href="Home">首页</a></li>
        <li><a href="Style">菜谱分类</a></li>
        <li><a href="New">最新菜谱</a></li>
        <li><a href="Hot">热门菜谱</a></li>
        <li><a href="Like">我的收藏</a></li>
      </ul>
    </nav>
    <div class="header-actions">
      <div class="search-container">
        <%--                <form action="/search" method="post">--%>

        <input type="text" id="header-search" placeholder="搜索菜谱...">
        <button id="header-search-btn">
          <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
            <circle cx="11" cy="11" r="8"></circle>
            <line x1="21" y1="21" x2="16.65" y2="16.65"></line>
          </svg>
        </button>
        <%--                </form>--%>
      </div>
      <button class="publish-btn">发布菜谱</button>

      <%
        String Login=(String) request.getAttribute("Login");
        if(Login!=null&&!Login.isEmpty()){
      %>
      <div class="user-icon">
        <img src=<%=session.getAttribute("ico")%> alt="" class ="user-icon-img" >
        <ul class="Loginlist">
          <li>
            <a href="Home">
              <img src="chushi/img/favicon.ico" alt="" class="Loginlist-ico" />
              个人主页
            </a>
          </li>
          <li>
            <a href="Logout">
              <img src="chushi/img/favicon.ico" alt="" class="Loginlist-ico"/>
              退出登录
            </a>
          </li>
        </ul>
      </div>
      <% } else { %>
      <button class="login-up">登录|注册</button>
      <% } %>

    </div>
  </div>
</header>
<main class="main-container">
  <%
    List<Recipe> recipes=(List<Recipe>) request.getAttribute("recipes");
    for (Recipe recipe:recipes){
  %>
  <div class="main-context">
    <img src="chushi/img/favicon.ico"/>
    <a href="Home">首页</a>><a href="Style">菜谱</a>><a href=""><%=recipe.getName()%></a>
  </div>
    <div class="main-content">
      <h2><%=recipe.getName()%></h2>
      <img src="<%=recipe.getImage()%>" alt="红烧肉">
      <div class="steps">
        <h3>步骤</h3>
        <ol>
          <li><%=recipe.getContent()%></li>
        </ol>
      </div>
<%--      <div class="comment-section">--%>
<%--        <div class="comment-header">用户评论 <span>78</span></div>--%>
<%--        <div class="comment-form">--%>
<%--          <input type="text" placeholder="请留下您的评论">--%>
<%--          <button>提交评论</button>--%>
<%--        </div>--%>
<%--        <ul class="comment-list">--%>
<%--          <li>--%>
<%--            <img src="avatar1.jpg" alt="用户头像">--%>
<%--            <div>孔晓勇·1991-02-07</div>--%>
<%--            <p>非常美味的一道菜</p>--%>
<%--            <div class="likes">5</div>--%>
<%--            <div class="reply">回复</div>--%>
<%--          </li>--%>
<%--          <li>--%>
<%--            <img src="avatar2.jpg" alt="用户头像">--%>
<%--            <div>倪玉英·2014-04-13</div>--%>
<%--            <p>很好吃，强烈推荐</p>--%>
<%--            <div class="likes">4.5</div>--%>
<%--            <div class="reply">回复</div>--%>
<%--          </li>--%>
<%--          <li>--%>
<%--            <img src="avatar3.jpg" alt="用户头像">--%>
<%--            <div>尹晓杰·1973-05-29</div>--%>
<%--            <p>味道不错，值得一试</p>--%>
<%--            <div class="likes">4.2</div>--%>
<%--            <div class="reply">回复</div>--%>
<%--          </li>--%>
<%--          <!-- 添加更多评论项 -->--%>
<%--        </ul>--%>
<%--      </div>--%>
    </div>
  <%}%>

</main>
<footer>
  <div class="container">
    <div class="footer-content">
      <div class="footer-section">
        <h4>菜谱管理系统</h4>
        <p>菜谱管理系统是一个专注于分享和管理菜谱的平台。</p>
      </div>
      <div class="footer-section">
        <h4>菜谱分类</h4>
        <ul>
          <li><a href="#">热菜</a></li>
          <li><a href="#">凉菜</a></li>
          <li><a href="#">主食</a></li>
          <li><a href="#">甜点</a></li>
          <li><a href="#">饮品</a></li>
        </ul>
      </div>
      <div class="footer-section">
        <h4>关于我们</h4>
        <ul>
          <li><a href="#">公司简介</a></li>
          <li><a href="#">联系我们</a></li>
          <li><a href="#">加入我们</a></li>
          <li><a href="#">合作伙伴</a></li>
        </ul>
      </div>
      <div class="footer-section">
        <h4>关注我们</h4>
        <div class="social-icons">
          <a href="#" class="social-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
              <path d="M18.77 7.46H14.5v-1.9c0-.9.6-1.1 1-1.1h3V.5h-4.33C10.24.5 9.5 3.44 9.5 5.32v2.15h-3v4h3v12h5v-12h3.85l.42-4z"/>
            </svg>
          </a>
          <a href="#" class="social-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
              <path d="M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838c-3.403 0-6.162 2.759-6.162 6.162s2.759 6.163 6.162 6.163 6.162-2.759 6.162-6.163c0-3.403-2.759-6.162-6.162-6.162zm0 10.162c-2.209 0-4-1.79-4-4 0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.21-1.791 4-4 4zm6.406-11.845c-.796 0-1.441.645-1.441 1.44s.645 1.44 1.441 1.44c.795 0 1.439-.645 1.439-1.44s-.644-1.44-1.439-1.44z"/>
            </svg>
          </a>
          <a href="#" class="social-icon">
            <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
              <path d="M24 4.557c-.883.392-1.832.656-2.828.775 1.017-.609 1.798-1.574 2.165-2.724-.951.564-2.005.974-3.127 1.195-.897-.957-2.178-1.555-3.594-1.555-3.179 0-5.515 2.966-4.797 6.045-4.091-.205-7.719-2.165-10.148-5.144-1.29 2.213-.669 5.108 1.523 6.574-.806-.026-1.566-.247-2.229-.616-.054 2.281 1.581 4.415 3.949 4.89-.693.188-1.452.232-2.224.084.626 1.956 2.444 3.379 4.6 3.419-2.07 1.623-4.678 2.348-7.29 2.04 2.179 1.397 4.768 2.212 7.548 2.212 9.142 0 14.307-7.721 13.995-14.646.962-.695 1.797-1.562 2.457-2.549z"/>
            </svg>
          </a>
        </div>
      </div>
    </div>
    <div class="footer-bottom">
      <p>&copy; 2023 菜谱管理系统, 保留所有权利。</p>
      <div class="footer-links">
        <a href="#">隐私政策</a>
        <a href="#">使用条款</a>
        <a href="#">Cookie设置</a>
      </div>
    </div>
  </div>
</footer>
<script src="chushi/script/header_script.js"></script>
<script>

</script>
</body>
</html>
